<template>
	<div class="manage">
		<el-container>
			<el-aside class="menu" style="width:230px;">
				<!-- <div class="title-user">个人中心</div> -->
				<el-menu router :default-active="$route.path">
					<!-- <el-submenu index="1">
						<template slot="title">
							<i class="el-icon-tickets"></i>
							<span slot="title">技术服务管理</span>
						</template> -->
						<!-- <el-menu-item index="userRegister">版权登记</el-menu-item> -->
						<!--<el-menu-item index="userMonitor">版权监测</el-menu-item>-->
						<!-- <el-menu-item index="/user/userDown">版权下架</el-menu-item> -->

						<!-- <el-menu-item index="/user/orderlist">版权存证订单</el-menu-item> -->
						<!-- <el-menu-item index="/user/userRegisterTwo">作品登记证书订单</el-menu-item> -->
					<!-- </el-submenu> -->
					
					<el-menu-item index="/user/crMonitor">
						<i class="el-icon-news"></i>
						<span slot="title">版权监测</span>
					</el-menu-item>
					<!-- <el-submenu index="2">
						<template slot="title">
							<i class="el-icon-news"></i>
							<span slot="title">版权服务管理</span>
						</template> -->
						<!-- <el-menu-item index="/user/userRegister">版权登记</el-menu-item> -->
						<!-- <el-menu-item index="/user/crMonitor">版权监测</el-menu-item> -->
						<!-- <el-menu-item index="/user/userDown">版权下架</el-menu-item> -->
					<!-- </el-submenu> -->
					<el-submenu index="3">
						<template slot="title">
							<i class="el-icon-setting"></i>
							<span slot="title">个人信息管理</span>
						</template>
						<el-menu-item index="/user/userinfo">个人资料</el-menu-item>
						<el-menu-item index="/user/identity">实名认证</el-menu-item>
						<el-menu-item index="/user/obligee">权利人管理</el-menu-item>
						<el-menu-item index="/user/password">密码修改</el-menu-item>
					</el-submenu>
					<!-- <el-menu-item index="/user/userPayment"> -->
						<!-- <i class="el-icon-document"></i> -->
						<!-- <span slot="title">支付记录管理</span> -->
					<!-- </el-menu-item> -->
					
					<el-menu-item index="20" @click="logoutFn">
						<i class="el-icon-circle-close-outline"></i>
						<span slot="title">退出登录</span>
					</el-menu-item>
				</el-menu>
			</el-aside>
			<el-main class="content">
				<router-view/>
			</el-main>
		</el-container>
	</div>
</template>

<script>
import { userregister, userDel, logout } from "@/api";
import { mapState, mapMutations } from "vuex";
export default {
    data: function() {
        return {
            page: 1,
			total: 0,
			// openeds: [],
        };
    },
	computed: {
		...mapState([
			'croUser',
		]),
	},
// 	watch:{
// 　　　　'$route': 'historyWatch'
// 	},
	methods: {
		...mapMutations([
			'OUT_LOGIN',
		]),
        logoutFn() {
            var para = {
                session_id: this.croUser.session_id,
                cur_uid: this.croUser.user_id
            };
            logout(para).then(data => {
				let para = {
					cur_uid: this.croUser.user_id
				}
				logout(para).then(res => {
					let {data, msg} = res;
					if(!data){
						this.$message.error(msg);
					}else {
						this.OUT_LOGIN();
						this.$router.push('/index');
					}
				});
            });
        }
    },
};
</script>
<style lang="scss" scoped>
.manage {
    width: 1200px;
    margin: 15px auto;
    background: #fff;
    border: 1px solid #e6e6e6;
	.title-user {
		background: #be1414;
		color:#fff;
		font-size: 14px;
		text-align: center;
		height: 50px;
		line-height:50px;
	}
    .menu {
        .el-menu {
            height: 100%;
        }
    }
}
</style>

